package dto

import (
	"equantum/model"

	uuid "github.com/satori/go.uuid"
)

type FileContentDto struct {
	Content string `json:"content"`
}

type FileNameDto struct {
	ID   uuid.UUID `json:"id"`
	Name string    `json:"value"`
}

func ToFileContentDto(file model.File) FileContentDto {
	return FileContentDto{
		Content: file.Content,
	}
}

func ToFileNameArrDto(fileArr []model.File) []FileNameDto {
	var fileNameArr []FileNameDto

	for _, file := range fileArr {
		fileNameArr = append(fileNameArr, FileNameDto{ID: file.ID, Name: file.Name})
	}

	return fileNameArr
}
